package store.lunangangster.engine;

import java.io.InputStream;
import org.springframework.core.io.Resource;

/**
 * {@link ProcessEngine}工具类
 *
 * @author cwk
 * @version 1.0
 */
public class ProcessEngines {

  public static ProcessEngine getDefaultProcessEngine() {
    return ProcessEngineConfiguration.createDefaultConfiguration().buildEngine();
  }

  public static ProcessEngine getDefaultProcessEngine(String beanName) {
    return ProcessEngineConfiguration.createDefaultConfiguration(beanName).buildEngine();
  }

  public static ProcessEngine getProcessEngine(InputStream is) {
    return ProcessEngineConfiguration.createConfigurationFromInputStream(is).buildEngine();
  }

  public static ProcessEngine getProcessEngine(InputStream is, String beanName) {
    return ProcessEngineConfiguration.createConfigurationFromInputStream(is, beanName).buildEngine();
  }

  public static ProcessEngine getProcessEngine(Resource resource) {
    return ProcessEngineConfiguration.createConfigurationFromResource(resource).buildEngine();
  }

  public static ProcessEngine getProcessEngine(Resource resource, String beanName) {
    return ProcessEngineConfiguration.createConfigurationFromResource(resource, beanName).buildEngine();
  }

  public static ProcessEngine getProcessEngine(String resourcePath) {
    return ProcessEngineConfiguration.createConfigurationFromResourcePath(resourcePath).buildEngine();
  }

  public static ProcessEngine getProcessEngine(String resourcePath, String beanName) {
    return ProcessEngineConfiguration.createConfigurationFromResourcePath(resourcePath, beanName).buildEngine();
  }

}
